package ldh.im.fxbase.rpc.service;

import ldh.im.dto.base.OkListReq;
import ldh.im.dto.base.OkListResp;
import ldh.im.dto.base.OkReq;
import ldh.im.dto.base.OkResp;
import ldh.im.dto.business.av.AvInvitationReq;
import ldh.im.dto.business.base.DataChangeReq;
import ldh.im.dto.business.file.FileUploadSuccessReq;
import ldh.im.dto.business.item.InvitationResult;
import ldh.im.dto.business.item.InvitationResultList;
import ldh.im.dto.business.message.MessageObject;
import ldh.im.dto.business.message.MessageObjectsReq;
import ldh.im.dto.business.message.MessageReadReq;
import ldh.im.dto.business.message.MessageWithdrawReq;
import ldh.im.dto.business.user.UserUpdateReq;
import ldh.im.dto.business.webrtc.WebRtcInvitationReq;
import ldh.im.dto.business.webrtc.WebRtcInvitationResultReq;
import ldh.rpc.Rpc;
import ldh.rpc.RpcMapper;
import ldh.rpc.exception.RpcException;

@Rpc
public interface RpcMessageService {

    /**
     * 发送消息：p2p消息，群消息
     * @param messageObject
     * @return
     * @throws RpcException
     */
    @RpcMapper(path="imMessage")
    OkResp sendMessage(MessageObject messageObject) throws RpcException;

    /**
     * 批量发送消息
     * @param messageObjectsReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path="imMessages")
    OkListResp sendMessages(MessageObjectsReq messageObjectsReq) throws RpcException;

    @RpcMapper(path="okMessage")
    void okMessage(OkReq okReq) throws RpcException;

    // 拉取消息进行确认
    @RpcMapper(path="okMessages")
    void okMessages(OkListReq okListReq) throws RpcException;

    @RpcMapper(path="userUpdateInfo")
    String userUpdateInfo(UserUpdateReq userUpdateReq) throws RpcException;

    @RpcMapper(path="fileUploadSuccess")
    String sendFileUploadSuccess(FileUploadSuccessReq fileUploadSuccessReq) throws RpcException;

    /**
     * 发送消息已读事件
     * @param messageReadReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path="readMessages", readTimeout = 120)
    OkResp sendReadMessages(MessageReadReq messageReadReq) throws RpcException;

    /**
     * 发送消息撤回事件
     * @param messageWithdrawReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path="withdrawMessages")
    OkResp sendWithdrawMessages(MessageWithdrawReq messageWithdrawReq) throws RpcException;

    /**
     * 数据变更
     * @param dataChangeReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path="dataChange")
    OkResp sendDataChange(DataChangeReq dataChangeReq) throws RpcException;
}
